<?php
/**
 *	[TWCMS] (C)2012 TongWang Inc.
 *	$Id: category_show.tpl.php 2 2013-04-27 07:14:17Z nanown@qq.com $
 */
	defined('IN_TWCMS') || exit('Access Denied');
	include load_tpl('head');
?>
	<link rel="stylesheet" href="<?=TWCMS_STATIC?>jqui/ui.css">
	<div class="head">
		<dl>
			<input id="addCate" type="button" value="增加分类" class="but1" />
			<dd class="on"><?=$this->title?></dd>
		</dl>
	</div>

	<div class="p c2">
		<div class="cc">
			<div id="cadd">
				<form id="formcate" method="post" action="?mod=category&action=show&do=ajax_add">
				<table class="tb">
					<thead>
						<tr>
							<th>上级分类</th>
							<td>
								<select name="upid">
									<option value="0">顶级目录</option>
									<?php foreach($this->category as $lv) {?>
									<option value="<?=$lv['cid']?>"><?=str_repeat("　", $lv['pre'])?>|─<?=$lv['categoryname']?></option>
									<?php } ?>
								</select>
							</td>
						</tr>

						<tr>
							<th>分类模型</th>
							<td>
								<?php foreach($this->model as $mid=>$name) { ?>						
								<label><input class="mr3" name="mid" type="radio" value="<?=$mid?>"<?php echo $mid==3 ? ' checked="checked"' : ''; ?>><?=$name?></label>
								<?php } ?>
							</td>
						</tr>
						<tr>
							<th>分类属性</th>
							<td><label><input name="isindex" type="radio" value="0" checked="checked">列表(可发表内容)</label><label><input name="isindex" type="radio" value="1">频道(不可发表内容)</label></td>
						</tr>
						<tr>
							<th>分类名称</th>
							<td><input name="categoryname" type="text" class="inp w4" />
						</tr>
						<tr>
							<th>英文目录</th>
							<td><input name="dir" type="text" class="inp w4" />
						</tr>
						<tr midval="2" style="display:none">
							<th>单页内容</th>
							<td><textarea id="pagecontent" name="pagecontent" style="width:100%;min-height:200px"></textarea></td>
						</tr>
						<tr>
							<th>更多选项</th>
							<td><input type="checkbox" id="more" /></td>
						</tr>
					</thead>

					<tbody style="display:none">
						<tr><td colspan="2"><div class="tb_t">SEO设置</div></td></tr>
						<tr>
							<th>副标题</th>
							<td><input class="inp w4" type="text" name="seotitle" /></td>
						</tr>
						<tr>
							<th>关键字</th>
							<td><input class="inp w4" type="text" name="keywords" /></td>
						</tr>
						<tr>
							<th>分类描述</th>
							<td><input class="inp w4" type="text" name="description" /></td>
						</tr>


						<tr><td colspan="2"><div class="tb_t">模板设置</div></td></tr>
						<tr>
							<th>分类模板</th>
							<td><input class="inp w4" type="text" name="cate_tpl" /></td>
						</tr>
						<tr>
							<th>内容模板</th>
							<td><input class="inp w4" type="text" name="show_tpl" /></td>
						</tr>

						<tr><td colspan="2"><div class="tb_t">生成静态</div></td></tr>
						<tr>
							<th>分类URL规则</th>
							<td><input class="inp w4" type="text" name="cate_url" /></td>
						</tr>
						<tr>
							<th>内容URL规则</th>
							<td><input class="inp w4" type="text" name="show_url" /></td>
						</tr>

						<tr><td colspan="2"><div class="tb_t">其他设置</div></td></tr>
						<tr>
							<th>排列顺序</th>
							<td><input class="inp wnum" type="number" name="orderby" value="0" /></td>
						</tr>
					</tbody>
				</table>
				</form>
			</div>
			<?php 
				$str = $this->get_category_html();
				if(empty($str)) {
					skyTips('暂无分类');
				}
				echo '<div class="cat">'.$str.'</div>';
			?>
		</div>
	</div>
</div>
<?php echo getTwEditor($this->G); ?>
<script type="text/javascript">var url_cate="<?=$this->G['url_cate'].P?>", twStatic="<?=TWCMS_STATIC?>", twEditor="<?=TWCMS_EDITOR?>";</script>
<script type="text/javascript" src="<?=TWCMS_STATIC?>js/jqueryui.js" defer="defer"></script>
<script src="<?=TWCMS_ADMSTATIC?>js/category.js" type="text/javascript" defer="defer"></script>
</body>
</html>